package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**
 * 充值记录
 */
public class Pay extends XtomObject implements Serializable {

	private static final long serialVersionUID = 1L;

	private String client_id;// 用户id
	private String keytype;// 充值类型 类别	1充值;2购物
	private String paytype;// 付款类型	第三方类别（1支付宝;2银联;3微信）
	private String out_trade_no;// 我方充值单号
	private String trade_no;// 第三方充值单号 流水号
	private String total_fee;// 充值金额
	private String payflag;// 充值回执状态 回执状态 0：失败或等待 1：已充值成功
	private String regdate;// 日期

	public Pay(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				client_id = get(jsonObject, "client_id");
				keytype = get(jsonObject, "keytype");
				paytype = get(jsonObject, "paytype");
				out_trade_no = get(jsonObject, "out_trade_no");
				trade_no = get(jsonObject, "trade_no");
				total_fee = get(jsonObject, "total_fee");
				payflag = get(jsonObject, "payflag");
				regdate = get(jsonObject, "regdate");

				log_i(toString());
			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}

	@Override
	public String toString() {
		return "Pay [client_id=" + client_id + ", keytype=" + keytype
				+ ", paytype=" + paytype + ", out_trade_no=" + out_trade_no
				+ ", trade_no=" + trade_no + ", total_fee=" + total_fee
				+ ", payflag=" + payflag + ", regdate=" + regdate + "]";
	}

	public String getClient_id() {
		return client_id;
	}

	public String getKeytype() {
		return keytype;
	}

	public String getPaytype() {
		return paytype;
	}

	public String getOut_trade_no() {
		return out_trade_no;
	}

	public String getTrade_no() {
		return trade_no;
	}

	public String getTotal_fee() {
		return total_fee;
	}

	public String getPayflag() {
		return payflag;
	}

	public String getRegdate() {
		return regdate;
	}

}
